package edu.ucsur.tp.veterinaria.forms;

import java.awt.EventQueue;

import javax.swing.JInternalFrame;
import java.awt.BorderLayout;
import javax.swing.JToolBar;
import javax.swing.JLabel;
import javax.swing.JButton;
import javax.swing.ImageIcon;
import javax.swing.JPanel;
import java.awt.Rectangle;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import javax.swing.BoxLayout;
import java.awt.Dimension;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.JScrollPane;

public class FormListadoPlantilla extends JInternalFrame {
  
  protected JTable tblResultados;
  protected JToolBar tlbAcciones;
  protected JLabel lblBarraEstado;
  protected JPanel pnlFiltros;
  protected JPanel pnlResultados;
  protected JScrollPane scrollPane;
  protected JButton btnNuevo;
  protected JButton btnEditar;
  protected JButton btnEliminar;
  protected JButton btnCopiar;
  protected JButton btnSalir;
  protected JButton btnRefrescar;

  /**
   * Launch the application.
   */
  public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
      public void run() {
        try {
          FormListadoPlantilla frame = new FormListadoPlantilla();
          frame.setVisible(true);
        } catch (Exception e) {
          e.printStackTrace();
        }
      }
    });
  }

  /**
   * Create the frame.
   */
  public FormListadoPlantilla() {
    setTitle("Listado de Registros");
    setBounds(100, 100, 765, 546);
    getContentPane().setLayout(new BorderLayout(0, 0));
    
    tlbAcciones = new JToolBar();
    getContentPane().add(tlbAcciones, BorderLayout.NORTH);
    
    btnNuevo = new JButton("");
    btnNuevo.setIcon(new ImageIcon(FormListadoPlantilla.class.getResource("/edu/ucsur/tp/veterinaria/images/icono_nuevo.png")));
    tlbAcciones.add(btnNuevo);
    
    btnEditar = new JButton("");
    btnEditar.setIcon(new ImageIcon(FormListadoPlantilla.class.getResource("/edu/ucsur/tp/veterinaria/images/icono_editar.png")));
    tlbAcciones.add(btnEditar);
    
    btnEliminar = new JButton("");
    btnEliminar.setIcon(new ImageIcon(FormListadoPlantilla.class.getResource("/edu/ucsur/tp/veterinaria/images/icono_eliminar.png")));
    tlbAcciones.add(btnEliminar);
    
    btnRefrescar = new JButton("");
    btnRefrescar.setIcon(new ImageIcon(FormListadoPlantilla.class.getResource("/edu/ucsur/tp/veterinaria/images/icono_refresh.png")));
    tlbAcciones.add(btnRefrescar);
    
    btnCopiar = new JButton("");
    btnCopiar.setIcon(new ImageIcon(FormListadoPlantilla.class.getResource("/edu/ucsur/tp/veterinaria/images/icono_copiar.png")));
    tlbAcciones.add(btnCopiar);
    
    btnSalir = new JButton("");
    btnSalir.setIcon(new ImageIcon(FormListadoPlantilla.class.getResource("/edu/ucsur/tp/veterinaria/images/icono_exit.png")));
    tlbAcciones.add(btnSalir);
    
    lblBarraEstado = new JLabel("Mantenimiento: General  |  Usuario: JTOVAR  |  Fecha/Hora: 20/09/2014 11:28 a.m.  |  Rol: Administrador");
    getContentPane().add(lblBarraEstado, BorderLayout.SOUTH);
    
    JPanel pnlPrincipal = new JPanel();
    getContentPane().add(pnlPrincipal, BorderLayout.CENTER);
    pnlPrincipal.setLayout(new BoxLayout(pnlPrincipal, BoxLayout.Y_AXIS));
    
    pnlFiltros = new JPanel();
    pnlFiltros.setPreferredSize(new Dimension(10, 200));
    pnlFiltros.setMinimumSize(new Dimension(10, 200));
    pnlFiltros.setMaximumSize(new Dimension(32767, 200));
    pnlPrincipal.add(pnlFiltros);
    pnlFiltros.setLayout(null);
    
    pnlResultados = new JPanel();
    pnlPrincipal.add(pnlResultados);
    pnlResultados.setLayout(new BorderLayout(0, 0));
    
    tblResultados = new JTable();
    tblResultados.setModel(new DefaultTableModel(
      new Object[][] {
        {null, null, null, null},
        {null, null, null, null},
        {null, null, null, null},
        {null, null, null, null},
        {null, null, null, null},
        {null, null, null, null},
      },
      new String[] {
        "Codigo", "Nombre", "Descripci\u00F3n", "Estado"
      }
    ));
    tblResultados.getColumnModel().getColumn(0).setMinWidth(75);
    tblResultados.getColumnModel().getColumn(1).setPreferredWidth(175);
    tblResultados.getColumnModel().getColumn(2).setPreferredWidth(175);
    
    scrollPane = new JScrollPane(tblResultados);
    pnlResultados.add(scrollPane, BorderLayout.CENTER);

  }

}
